package demo.command;

/**
 * @author zheng9feng
 * @date 2021/5/10 10:27
 * 启动一个java进程，使用jps查看pid jps -l
 * jinfo:实时地查看和调整虚拟机各项参数    Configuration Info for Java
 * Usage:
 * jinfo <option> <pid>
 * (to connect to a running process)
 * <p>
 * where <option> is one of:
 * -flag <name>         to print the value of the named VM flag
 * -flag [+|-]<name>    to enable or disable the named VM flag
 * -flag <name>=<value> to set the named VM flag to the given value
 * -flags               to print VM flags
 * -sysprops            to print Java system properties
 * <no option>          to print both VM flags and system properties
 * -? | -h | --help | -help to print this help message
 * <p>
 * jinfo vmid :输出当前 jvm 进程的全部参数和系统属性 (第一部分是系统的属性，第二部分是 JVM 的参数)。
 * jinfo -flag [+|-]name vmid 开启或者关闭对应名称的参数
 * ref:https://www.cnblogs.com/lizhonghua34/p/7307139.html
 * e.g.查看当前进程是否开启PrintGC--开启PrintGC
 * 查看：jinfo -flag PringGC vmid
 * 开启：jinfo  -flag  +PrintGC vmid
 * ***********************************************************************************************************************
 * jstat:监视虚拟机各种运行状态信息 ref:https://www.cnblogs.com/yjd_hycf_space/p/7755633.html    JVM Statistics Monitoring Tool
 * jstat -gc vmid ：显示与 GC 相关的堆信息
 * jstat -gccapacity vmid ：显示各个代的容量及使用情况
 * jstat -gcutil vmid ：显示垃圾收集信息
 * ***********************************************************************************************************************
 * jmap:生成堆转储快照 Memory Map for Java
 * Example: jmap -dump:live,format=b,file=heap.bin <pid>
 * jmap -dump:live,format=b,file=heap-dump-vmid.hprof vmid  注意：堆转储快照扩展名使用.hprof，jvisualvm可以识别该扩展名
 * 可以使用jhat或jvisualvm分析堆转储快照
 * jhat D:\zone\document\idea-root\jvm-labs\jvm-lab-1\heapdump.hprof
 * Reading from D:\zone\document\idea-root\jvm-labs\jvm-lab-1\heapdump.hprof...euse it for its own console output.
 * Dump file created Mon May 10 11:37:27 CST 2021 of the running program.
 * Snapshot read, resolving... suppress console output.
 * Resolving 45110 objects...ate a separate console window.
 * Chasing references, expect 9 dots.........
 * Eliminating duplicate references.........
 * Snapshot resolved.
 * Started HTTP server on port 7000
 * Server is ready.
 * 访问地址:http://localhost:7000/
 */
public class SimpleProcess {
	public static void main(String[] args) {
		while (true) {

		}
	}
}
